@use 'mixins/config' as *;
@use 'mixins/mixins' as *;
@use 'mixins/function' as *;

@include b(table) {
  /* 自定义列栏 */
  @include b(table-column) {
    @include e(header) {
      @include e(header__icon) {
        margin-top: -2px;
        margin-left: 2px;
        vertical-align: middle;
      }
    }
  }

  /* 操作栏 */
  @include b(table-action-bar) {
    &.is-center {
      .cell {
        justify-content: center;
      }
    }
    &.is-right {
      .cell {
        justify-content: flex-end;
      }
    }

    &.#{$el-namespace + -table-fixed-column--right} {
      background-color: getCssVar('bg-color');
    }

    .cell {
      display: flex;
      align-items: center;
    }

    @include e(dropdown__link) {
      display: inline-flex;
      cursor: pointer;
      user-select: none;
      color: getCssVar('color-primary');
    }
    @include e(more-text) {
      margin-right: 2px;
    }
    @include e(column__link) {
      margin-right: 10px;
    }
    @include e(dropdown) {
      vertical-align: baseline;
      cursor: pointer;
      margin-left: 12px;
    }
    @include elb(link) {
      & + .#{$el-namespace + -link} {
        margin-left: 12px;
      }
    }
    @include elb(icon) {
      cursor: pointer;

      & + .#{$el-namespace + -icon} {
        margin-left: 12px;
      }
    }
  }

  /* 排序 */
  @include b(table-column-drag-sort) {
    @include b(table-column-drag-icon) {
      cursor: move;
      padding: 4px;
      box-sizing: border-box;
      font-size: 18px;
    }
  }

  /* 序号栏 */
  @include b(table-column-index) {
    @include b(table-index-column) {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      word-break: keep-all;
      white-space: nowrap;
      width: 20px;
      height: 20px;
    }

    .cell {
      @include b(table-column-index__content) {
        align-items: center;
        display: flex;
        justify-content: center;
        overflow: hidden;
      }
    }
  }

  /*工具栏*/
  @include b(table-title-bar) {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
  }

  @include e(toolbar) {
    display: flex;
    align-items: center;
  }

  @include elb(popper) {
    max-width: 200px;
  }
}

/* 密度设置 */
@include b(table-title-bar__toolbar__density) {
  display: flex;
  flex-direction: column;
  align-items: center;

  @include elb(button) {
    margin-top: 10px;
    width: 80px;

    & + .#{$el-namespace + -button} {
      margin-left: 0;
    }
  }
}

@include b(table-title-bar__toolbar__icon) {
  margin-left: 10px;
  vertical-align: middle;
  cursor: pointer;
  color: getCssVar('text-color-regular');
}
/* 列设置 */
@include b(table-title-bar__toolbar__checkbox__item) {
  margin-left: 6px;
}
/* 列设置 拖拽 item */
@include b(table-checkbox-item) {
  display: flex;
  align-items: center;
  margin-left: 20px;
}
/* 列设置 拖拽handle  */
@include b(table-checkbox-handle) {
  font-size: 18px;
  cursor: move;
}

@include b(table-ghost-class) {
  padding: 0 5px;
  border: 1px dashed getCssVar('color-primary');
  background-color: #fff;
}

@include b(table-column__edit) {
  cursor: pointer;
}

@include b(table-checkbox-checkAll) {
  display: flex;
  justify-content: space-between;
}
